package com.ziq.zcamp.manager

import com.ziq.base.extension.launchWithTryAsyncGlobal
import kotlinx.coroutines.flow.MutableSharedFlow

class PushManager {

    private val noticeType = 1
    val noticePushFlow = MutableSharedFlow<String>(replay = 0)

    fun registerPush(manager : LongLinkManager){
        manager.registerPushListener(noticeType, object : LongLinkManager.IPushListener {
            override fun onReceive(data: String) {
                launchWithTryAsyncGlobal(whenTry = {

                    noticePushFlow.emit(data)
                })
            }
        })
    }


}